<?php
	class userloginModel extends Model{
		public function loginAction(){
            $name = $_POST["name"];
            $pwd = $_POST["pwd"];
            $sql="select * from user where email='{$name}' and pwd='{$pwd}'";
            $row = $this->link->selectDB($sql);
            if($row!=null){
                $_SESSION["user"]=$row[0];
            } 
            echo json_encode($row[0]);
		}
	}
	
?>